// 请求真实后端
import { request } from '@/api/service'
import globalAPI from '@/api/globalAPI'

export function GetList (query) {
  console.log(`query: ${JSON.stringify(query)}`)
  var queryStr = ''
  if (query.brandId !== undefined) {
    queryStr = `&brandId=${query.brandId}`
  }
  return request({
    url: `${globalAPI.BASE_URL}/stb/models/v1?size=${query.size}&current=${query.current}${queryStr}`,
    method: 'get'
  })
}

export function AddObj (obj) {
  return request({
    url: `${globalAPI.BASE_URL}/stb/model/v1`,
    method: 'put',
    data: obj
  })
}

export function UpdateObj (obj) {
  return request({
    url: `${globalAPI.BASE_URL}/stb/model/v1`,
    method: 'post',
    data: obj
  })
}
export function DelObj (id) {
  return request({
    url: `${globalAPI.BASE_URL}/stb/model/${id}/v1`,
    method: 'delete'
  })
}
